package com.chey.dao;

import com.chey.pojo.META;
import com.chey.pojo.blls.BELT;
import com.chey.pojo.dfdl.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author JanYao
 * @version 0.1
 */

public interface DfdlDao {

    @Select("insert into META(META_ID,SENDER,RECEIVER,SEQUENCE,DTIME,MTYPE,STYPE) values(#{uuid},#{meta.sender},#{meta.receiver},#{meta.sequence},#{meta.dTime},#{meta.bType},#{meta.sType})")
    public Integer addMeta(@Param("uuid") String uuid,@Param("meta") META meta);


    @Select("insert into MSG_DFOE_DFDL(META_ID,DFLT_ID,DLTP,RECD) values (#{uuid},#{uuid},#{msg.dltp},#{msg.recd})")
    public Integer addMSG(@Param("uuid") String uuid, @Param("msg") MSG23 msg);

@Select("insert into DFLT_BLLS_BELT values(#{belt.BTNO}, #{belt.ID}, #{belt.CODE}, #{belt.BTAT}, #{belt.ESTR}, #{belt.EEND}, #{belt.RSTR}, #{belt.REND}, #{belt.BTSC},#{uuid}) ")
   public Integer addBelt(@Param("uuid") String uuid, @Param("belt") BELT belt);


    @Select("insert into " +
            "DFOE_DFDL_DFLT " +
            "values(#{uuid},#{dflt.FLID},#{dflt.AFID},#{dflt.FFID},#{dflt.FIDE},#{dflt.TEST},#{dflt.AWCD},#{dflt.FLNO},#{dflt.FEXD},#{dflt.FIMD},#{dflt.FLIO},#{dflt.FLTK},#{dflt.FATT},#{dflt.PATT},#{dflt.MFID},#{dflt.MFFI},#{dflt.CFTP},#{dflt.CFNO},#{dflt.STAT},#{dflt.ABST},#{dflt.ABRS},#{dflt.ISTA},#{dflt.IAST},#{dflt.IARS},#{dflt.MSTA},#{dflt.MABS},#{dflt.MABR},#{dflt.MIST},#{dflt.MIAS},#{dflt.MIAR},#{dflt.BORT},#{dflt.MBOR},#{dflt.TBRT},#{dflt.MTBR},#{dflt.LBDT},#{dflt.MLBD},#{dflt.POKT},#{dflt.MPOK},#{dflt.APOT},#{dflt.DETT},#{dflt.DRTT},#{dflt.DELT},#{dflt.DRLT},#{dflt.VIP},#{uuid},#{dflt.PAST},#{arptid},#{uuid},#{dflt.GTLS},#{ckls.FCES},#{ckls.FCEE},#{ckls.FCRS},#{ckls.FCRE},#{ckls.MCES},#{ckls.MCEE},#{ckls.MCRS},#{ckls.MCRE},#{ckls.FCDP},#{ckls.MCDP},#{ckls.CNTR},#{dflt.CHLS},#{dflt.STLS},#{tmcd.NMCD},#{tmcd.JMCD},#{dflt.FLDT},#{dflt.LLDT},#{dflt.CONT},#{dflt.PROX})")
    public Integer addDflt(@Param("uuid") String uuid,@Param("arptid") String arptid, @Param("dflt") DFLT dflt, @Param("ckls") CKLS ckls,@Param("tmcd") TMCD tmcd);


    @Select("insert into ARPTS(AIRL_ARPT_ID,APNO,APCD,FPTT,FETT,FRTT,FPLT,FELT,FRLT,APAT) values(#{arptid},#{arpt.APNO},#{arpt.APCD},#{arpt.FPTT},#{arpt.FETT},#{arpt.FRTT},#{arpt.FPLT},#{arpt.FELT},#{arpt.FRLT},#{arpt.APAT})")
    public Integer addArptS(@Param("arptid") String arptid,@Param("arpt") ARPT arpt);

    @Select("insert into ARPTT(AIRL_ARPT_ID,APNO,APCD,FPTT,FETT,FRTT,FPLT,FELT,FRLT,APAT) values(#{arptid},#{arpt.APNO},#{arpt.APCD},#{arpt.FPTT},#{arpt.FETT},#{arpt.FRTT},#{arpt.FPLT},#{arpt.FELT},#{arpt.FRLT},#{arpt.APAT})")
    public Integer addArptT(@Param("arptid") String arptid,@Param("arpt") ARPT arpt);
    @Select("insert into ARPTE(AIRL_ARPT_ID,APNO,APCD,FPTT,FETT,FRTT,FPLT,FELT,FRLT,APAT) values(#{arptid},#{arpt.APNO},#{arpt.APCD},#{arpt.FPTT},#{arpt.FETT},#{arpt.FRTT},#{arpt.FPLT},#{arpt.FELT},#{arpt.FRLT},#{arpt.APAT})")
    public Integer addArptE(@Param("arptid") String arptid,@Param("arpt") ARPT arpt);

    @Select("insert into DFOE_SFLG_SFLT(SFLG_SFLT_ID,SFAW,SFNO) values(#{uuid},#{sflt.SFAW},#{sflt.SFNO})")
    public Integer addSflt(@Param("uuid") String uuid, @Param("sflt") SFLT sflt);
}
